<?php

use \Abstraction;

class TestController extends Abstraction\MvcController
{
    public $variables;
    public $action;
    
    public function __construct( $action, Core\MVCRequest $request )
    {
        $this->variables = $request->variables;
        $this->action = $action;
        
        parent::__construct( $action, $request );
    }
    
    public function testCreateActionMethod()
    {
        return $this->createActionMethodName( $this->action );
    }
    
    public function createResult2()
    {
        if( $this->action === 'no-return' )
        {
        }
        else if( $this->action === 'exception' )
        {
            throw new Exception('Sorry, failed ! ');
        }
        else
        {
            $res = new Entity\MvcResult();
            $res->variables = $this->variables;
            
            return $res;
        }
    }
    
    public function getVars()
    {
        return $this->variables;
    }
}
